﻿using System;
using Biljart.Model;

namespace Tests.Utils
{
    static class ObjectMother
    {
        public static User CreateUser()
        {
            var user = new User
                           {
                               Country = "Belgium",
                               FirstName = "Kevin",
                               LastName = "Van Den Elshout",
                               Handicap = 0,
                               Nickname = GenerateRandomString(),
                               Street = "Driesheidelaan",
                               Number = 14,
                               Town = "Zwijndrecht",
                               Zipcode = 2070
                           };
            return user;
        }

        public static string GenerateRandomString()
        {
            long i = 1;
            foreach (byte b in Guid.NewGuid().ToByteArray())
            {
                i *= ((int)b + 1);
            }
            return string.Format("{0:x}", i - DateTime.Now.Ticks);
        }

    }
}